package com.socialnetspace.dao;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.socialnetspace.domain.User;

@Repository
public class UserDAO extends BaseDAO implements IUserDAO {
	

	@Override
	@Transactional
	public void saveUser(User user) {		
		entityManager.merge(user);
	}


	@Override
	public User findUserByUsername(String username) {
		
		User user = new User();
		user.setEmailAddress("john@socialnetspace.com");
		user.setFirstName("John");
		user.setLastName("Doe");
		user.setPassword("hello");
		user.setRole("ROLE_ADMIN");
		user.setUsername("john");
		
		return user;
	}


}
